/**
 * @file NewProtocolCurtisRuiBoTe.h
 * @author SoBigDog (623644973lubin@163.com)
 * @brief 
 * @version 0.1
 * @date 2020-04-14
 * 
 * @copyright Copyright (c) 2020
 * 
 */
#pragma once

#include "ProtocolDriver.h"

class CNewProtocolCurtisRuiBoTe : public CDriverProtocol
{
public:
	CNewProtocolCurtisRuiBoTe();
	virtual ~CNewProtocolCurtisRuiBoTe(){}
	virtual void setMotorId(uint32_t id) {
		if (_motorType == 1 ) {
			_motorId = id;
			_motorRxId = 0x207;
			_motorTxId = 0x213;
		} else if (_motorType == 2 ) {
			_motorId = id;
			_motorRxId = 0x207;
			_motorTxId = 0x213;
		} else if (_motorType == 6 ) {
			_motorId = id;
			_motorRxId = 0x203;
			_motorTxId = 0x313;
		}
	}

	virtual uint32_t getSpecialRxId()
	{
		return 0x209;
	}
	
	virtual bool encode(motorDriverCmdType ct, int32_t val);
	virtual int decode(motorDriverCmdType (&ct)[10], int32_t (&val)[10], const CanRxMsg&);
private:
	static int16_t _speedVal;
	static int16_t _forkVel;
	static int16_t _lift_flag;
	static int16_t _lower_flag;
};
